home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / t2win-32 / _ieeenum.frm (.txt) < prev    next >
Visual Basic Form  |  1998-07-13  |  16KB  |  487 lines

  1. VERSION 5.00
  2. Begin VB.Form frmIeeenum 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Ieeenum"
  5.    ClientHeight    =   4845
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   10905
  9.    MaxButton       =   0   'False
  10.    MDIChild        =   -1  'True
  11.    PaletteMode     =   1  'UseZOrder
  12.    ScaleHeight     =   4845
  13.    ScaleWidth      =   10905
  14.    ShowInTaskbar   =   0   'False
  15.    Begin VB.Frame Frame1 
  16.       Height          =   570
  17.       Left            =   0
  18.       TabIndex        =   1
  19.       Top             =   -90
  20.       Width           =   10905
  21.       Begin VB.CommandButton cmdNP 
  22.          Caption         =   ">"
  23.          Height          =   285
  24.          Index           =   1
  25.          Left            =   10530
  26.          TabIndex        =   6
  27.          Top             =   195
  28.          Width           =   285
  29.       End
  30.       Begin VB.CommandButton cmdNP 
  31.          Caption         =   "<"
  32.          Height          =   285
  33.          Index           =   0
  34.          Left            =   9630
  35.          TabIndex        =   5
  36.          Top             =   195
  37.          Width           =   285
  38.       End
  39.       Begin VB.CommandButton Command1 
  40.          Caption         =   "&Go"
  41.          Default         =   -1  'True
  42.          Height          =   285
  43.          Left            =   9990
  44.          TabIndex        =   4
  45.          Top             =   195
  46.          Width           =   465
  47.       End
  48.       Begin VB.ComboBox cmb_Function 
  49.          Height          =   315
  50.          Left            =   1365
  51.          TabIndex        =   2
  52.          Top             =   180
  53.          Width           =   8175
  54.       End
  55.       Begin VB.Label Label2 
  56.          Caption         =   "&Select a function"
  57.          Height          =   255
  58.          Left            =   90
  59.          TabIndex        =   3
  60.          Top             =   210
  61.          Width           =   1275
  62.       End
  63.    End
  64.    Begin VB.Label lbl_Result 
  65.       Appearance      =   0  'Flat
  66.       BackColor       =   &H80000005&
  67.       BackStyle       =   0  'Transparent
  68.       ForeColor       =   &H80000008&
  69.       Height          =   4110
  70.       Left            =   90
  71.       TabIndex        =   0
  72.       Top             =   630
  73.       Width           =   10635
  74.    End
  75. Attribute VB_Name = "frmIeeenum"
  76. Attribute VB_GlobalNameSpace = False
  77. Attribute VB_Creatable = False
  78. Attribute VB_PredeclaredId = True
  79. Attribute VB_Exposed = False
  80. Option Explicit
  81. Option Base 1
  82. Private Const Iteration = 250
  83. Dim IsLoaded         As Integer
  84. Dim TimerStartOk     As Integer
  85. Dim TimerCloseOk     As Integer
  86. Dim TimerHandle      As Integer
  87. Dim TimerValue       As Long
  88. Private Sub cmdNP_Click(Index As Integer)
  89.    Call sub_NextPrev(cmb_Function, Index)
  90. End Sub
  91. Private Sub cmb_Function_Click()
  92.    If (IsLoaded = False) Then Exit Sub
  93.    Call cDisableFI(mdiT2W.Picture1)
  94.    lbl_Result = ""
  95.    DoEvents
  96.    Select Case cmb_Function.ListIndex
  97.       Case 0
  98.          Call TestByte
  99.       Case 1
  100.          Call TestInteger
  101.       Case 2
  102.          Call TestLong
  103.       Case 3
  104.          Call TestSingle
  105.       Case 4
  106.          Call TestDouble
  107.       Case 5
  108.          Call TestCurrency
  109.       Case 6
  110.          Call TestSMBF
  111.       Case 7
  112.          Call TestGetByte
  113.       Case 8
  114.          Call TestGetInteger
  115.       Case 9
  116.          Call TestGetLong
  117.       Case 10
  118.          Call TestGetSingle
  119.       Case 11
  120.          Call TestGetDouble
  121.       Case 12
  122.          Call TestGetCurrency
  123.    End Select
  124.    DoEvents
  125.    Call cEnableFI(mdiT2W.Picture1)
  126. End Sub
  127. Private Sub Form_Activate()
  128.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  129. End Sub
  130. Private Sub Form_Load()
  131.    IsLoaded = False
  132.    Show
  133.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_ieeenum.t2w")
  134.    IsLoaded = True
  135. End Sub
  136. Private Sub Command1_Click()
  137.    Call cmb_Function_Click
  138. End Sub
  139. Private Sub TestByte()
  140.    Dim intResult        As Integer
  141.    Dim strResult        As String
  142.    Dim strDisplay       As String
  143.    Dim i                As Integer
  144.    Dim j                As Byte
  145.    strResult = ""
  146.    strDisplay = ""
  147.      
  148.    For i = 1 To 7
  149.       j = Int((255 - 1 + 1) * Rnd + 1)
  150.       strResult = cMKB(j)
  151.       strDisplay = strDisplay + "MKB of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  152.       strDisplay = strDisplay + "CVB of '0x" & cToHexa(strResult) & "' is '" & cCVB(strResult) & "'" & vbCrLf & vbCrLf
  153.    Next i
  154.    lbl_Result = strDisplay
  155.    'time the function
  156.    TimerHandle = cTimerOpen()
  157.    TimerStartOk = cTimerStart(TimerHandle)
  158.    For i = 1 To Iteration
  159.       strResult = cMKB(j)
  160.    Next i
  161.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  162.    TimerCloseOk = cTimerClose(TimerHandle)
  163. End Sub
  164. Private Sub TestInteger()
  165.    Dim intResult        As Integer
  166.    Dim strResult        As String
  167.    Dim strDisplay       As String
  168.    Dim i                As Integer
  169.    Dim j                As Integer
  170.    strResult = ""
  171.    strDisplay = ""
  172.    Call cRndInit(-1)
  173.      
  174.    For i = 1 To 7
  175.       j = cRndI()
  176.       strResult = cMKI(j)
  177.       strDisplay = strDisplay + "MKI of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  178.       strDisplay = strDisplay + "CVI of '0x" & cToHexa(strResult) & "' is '" & cCVI(strResult) & "'" & vbCrLf & vbCrLf
  179.    Next i
  180.    lbl_Result = strDisplay
  181.    'time the function
  182.    TimerHandle = cTimerOpen()
  183.    TimerStartOk = cTimerStart(TimerHandle)
  184.    For i = 1 To Iteration
  185.       strResult = cMKI(j)
  186.    Next i
  187.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  188.    TimerCloseOk = cTimerClose(TimerHandle)
  189. End Sub
  190. Private Sub TestLong()
  191.    Dim intResult        As Integer
  192.    Dim strResult        As String
  193.    Dim strDisplay       As String
  194.    Dim i                As Integer
  195.    Dim j                As Long
  196.    strResult = ""
  197.    strDisplay = ""
  198.    Call cRndInit(-1)
  199.      
  200.    For i = 1 To 7
  201.       j = cRndL()
  202.       strResult = cMKL(j)
  203.       strDisplay = strDisplay + "MKL of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  204.       strDisplay = strDisplay + "CVL of '0x" & cToHexa(strResult) & "' is '" & cCVL(strResult) & "'" & vbCrLf & vbCrLf
  205.    Next i
  206.    lbl_Result = strDisplay
  207.    'time the function
  208.    TimerHandle = cTimerOpen()
  209.    TimerStartOk = cTimerStart(TimerHandle)
  210.    For i = 1 To Iteration
  211.       strResult = cMKL(j)
  212.    Next i
  213.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  214.    TimerCloseOk = cTimerClose(TimerHandle)
  215. End Sub
  216. Private Sub TestSingle()
  217.    Dim intResult        As Integer
  218.    Dim strResult        As String
  219.    Dim strDisplay       As String
  220.    Dim i                As Integer
  221.    Dim j                As Single
  222.    strResult = ""
  223.    strDisplay = ""
  224.    Call cRndInit(-1)
  225.      
  226.    For i = 1 To 7
  227.       j = cRndS()
  228.       strResult = cMKS(j)
  229.       strDisplay = strDisplay + "MKS of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  230.       strDisplay = strDisplay + "CVS of '0x" & cToHexa(strResult) & "' is '" & cCVS(strResult) & "'" & vbCrLf & vbCrLf
  231.    Next i
  232.    lbl_Result = strDisplay
  233.    'time the function
  234.    TimerHandle = cTimerOpen()
  235.    TimerStartOk = cTimerStart(TimerHandle)
  236.    For i = 1 To Iteration
  237.       strResult = cMKS(j)
  238.    Next i
  239.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  240.    TimerCloseOk = cTimerClose(TimerHandle)
  241. End Sub
  242. Private Sub TestDouble()
  243.    Dim intResult        As Integer
  244.    Dim strResult        As String
  245.    Dim strDisplay       As String
  246.    Dim i                As Integer
  247.    Dim j                As Double
  248.    strResult = ""
  249.    strDisplay = ""
  250.    Call cRndInit(-1)
  251.      
  252.    For i = 1 To 7
  253.       j = cRndD()
  254.       strResult = cMKD(j)
  255.       strDisplay = strDisplay + "MKD of '" & j & "' is '0x" & cToHexa(strResult) & "'" & vbCrLf
  256.       strDisplay = strDisplay + "CVD of '0x" & cToHexa(strResult) & "' is '" & cCVD(strResult) & "'" & vbCrLf & vbCrLf
  257.    Next i
  258.    lbl_Result = strDisplay
  259.    'time the function
  260.    TimerHandle = cTimerOpen()
  261.    TimerStartOk = cTimerStart(TimerHandle)
  262.    For i = 1 To Iteration
  263.       strResult = cMKD(j)
  264.    Next i
  265.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  266.    TimerCloseOk = cTimerClose(TimerHandle)
  267. End Sub
  268. Private Sub TestCurrency()
  269.    Dim intResult        As Integer
  270.    Dim strResult        As String
  271.    Dim strDisplay       As String
  272.    Dim i                As Integer
  273.    Dim j                As Currency
  274.    strResult = ""
  275.    strDisplay = ""
  276.    Call cRndInit(-